<?php
$conn = ldap_connect("39.108.152.174",636);

if($conn){
//    ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);

    $dn = "DC=toby,DC=com";
    $pass = "";
    $ldapbind = ldap_bind($conn, $dn, $pass); //this is the point we are authenticating

    $a = ldap_search($conn,"","");
    var_dump($a);

//    $dn = "cn=Users,dc=toby,dc=com"; //very important: in which part of your database are you looking
//    $filter = "uid=*"; //don't filter anyone out (every user has a uid)
//    $sr = ldap_search($conn, $dn, $filter) or die ("bummer"); //define your search scope


    ldap_close($conn);
}
